//
//  UILabel+Extension.swift
//  新浪微博
//
//  Created by Mac on 17/1/2.
//  Copyright © 2017年 itcast. All rights reserved.
//

import UIKit

extension UILabel {

    // 提供简单方案
    convenience init(text:String){
        self.init()
        self.text = text
    }
    
    // 文字,文字颜色,
    convenience init(text:String,textColor:UIColor){
        self.init()
        self.text = text
        self.textColor = textColor
    }
    
    // 文字,文字颜色,文字大小
    convenience init(text:String, textColor:UIColor, textFontSize:CGFloat){
        self.init()
        self.text = text
        self.textColor = textColor
        self.font = UIFont.systemFont(ofSize: textFontSize)
    }
    
    // 文字与背景
    convenience init(text:String, textColor:UIColor, textFontSize:CGFloat, numberOflines:CGFloat, backgroundColor:UIColor){
        self.init()
        self.text = text
        self.textColor = textColor
        self.font = UIFont.systemFont(ofSize: textFontSize)
        self.backgroundColor = backgroundColor
    }
}
